package com.caisejingyu.whales.home.devices.printer;

/**
 * Created by fengxing on 2017/2/23.
 */

public class PrintPageConstants {
    public final static int PRINT_PAGE_TYPE_A7 = 1;//7寸大小
    public final static int PRINT_PAGE_TYPE_A7_1 = 5;//7寸大小可以撕（包括图片和优惠券）
    public final static int PRINT_PAGE_TYPE_A6 = 2;

    /**
     * 打印纸张类型
     */
    private static int PRINT_PAGE_TYPE = PRINT_PAGE_TYPE_A7;

    /**
     * 打印的偏移量
     */
    private static volatile int sPrintHorizontalOffset = 0;

    public static synchronized int getPrintPageType() {
        return PRINT_PAGE_TYPE;
    }

    public static int setPrintPageType(int printType) {
        if (PRINT_PAGE_TYPE != printType) {
            synchronized (PrintPageConstants.class) {
                if (PRINT_PAGE_TYPE != printType) {
                    PRINT_PAGE_TYPE = printType;
                }
            }
        }
        return PRINT_PAGE_TYPE;
    }

    public static int getPrintHorizontalOffset() {
        return sPrintHorizontalOffset;
    }

    public static void setPrintHorizontalOffset(int horizontalOffset) {
        sPrintHorizontalOffset = horizontalOffset;
    }
}
